<?php
global $e107shop_db_name, $shop_settings, $sql;

$sql = new db;
$sql->db_Select($e107shop_db_name['gateways'], "*", "identifier='saman'");

while ($row=$sql->db_Fetch()) {
    $saman_id  = $row['account'];
    $saman_url = $row['field1'];
    $saman_logo = $row['field2'];
}

$language = "fa_ir";

$orderid = e107shop_order_id();

$temp .= "   
<form action='$saman_url' method='post' id='form1' name='form1'>
<input type='hidden' name='MID' value='$saman_id'>
<input type='hidden' name='RedirectURL' value='".$shop_settings['path']."saman_accepted.php'>
<input type='hidden' name='TableBorderColor' value='488DCC'>
<input type='hidden' name='TableBGColor' value='488DCC'>
<input type='hidden' name='PageBGColor' value='B6CBEA'>
<input type='hidden' name='PageBorderColor' value='6C788B'>
<input type='hidden' name='TitleFont' value='Tahoma'>
<input type='hidden' name='TitleColor' value='000000'>
<input type='hidden' name='TitleSize' value='5'>
<input type='hidden' name='TextFont' value='Tahoma'>
<input type='hidden' name='TextColor' value='000000'>
<input type='hidden' name='TextSize' value='2'>
<input type='hidden' name='TypeTextFont' value='Tahoma'>
<input type='hidden' name='TypeTextColor' value='000000'>
<input type='hidden' name='TypeTextSize' value='2'>
<input type='hidden' name='LogoURL' value='".$saman_logo."'>
<input type='hidden' name='Amount' value='".$total."'>
<input type='hidden' name='ResNum' value='10000001'>
";

$temp .= "<input type='submit' value='پرداخت' dir='rtl' id='submit2' name='submit2'></form>";

e107shop_process_order($orderid, "pending", $cart_id, "saman", $region, $coupon);
$total = $total / 1000;
return $temp;
